package Class_03_22;

class Animal1 {
    //extends
    //private的属性无法继承 —— 可提供public方法进行调用
    private int age;
    private String name;
    private String sex;
    public final String COLOR = "黑色";

    public Animal1(int age, String name, String sex) {
        this.age = age;
        this.name = name;
        this.sex = sex;
    }

    public Animal1() {
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
}

class Dog extends Animal1{

}

public class AnimalTest1 {


    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.setName("旺财");
        dog.setAge(6);
        dog.setSex("male");
        System.out.println("名称:" + dog.getName() + "  " + "年龄:" + dog.getAge() + "  " + "性别" + dog.getSex());
    }
}
